<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');$set = setting_get('tt_read');?>
<form action="<?php echo url("plugin-setting-tt_read");?>" method="post" id="form">
<div class="row"><div class="col-lg-10 mx-auto"><div class="card"><div class="card-body" >
<h3>后期技术支持</h3>官方网站：http://www.6rabbit.com/ <a href="http://www.6rabbit.com"target="_blank" style="text-decoration: none">点击进入</a><br>官方QQ群：58911696（正常群）、77868272（只吹牛不讨论正事）</div></div>
<div class="card"><div class="card-body" ><h3>阅读权限设置</h3>
    <table class="table"><tr><th>用户组名称</th><th>阅读权限（1-999）<br><span style="color:red">阅读权限必须大于0，否则会出错</span></th><th>允许发表带阅读权限的帖子</th></tr>
<?php foreach($grouplist as $_group){?><tr><td> <?php echo $_group['name']; ?></td>
<td><input type="input" class="form-control" name="read_group[<?php echo $_group['gid']; ?>]" value="<?php echo $_group['readp']?>"/></td>
<td><input type="checkbox" name="read_PostRead[<?php echo $_group['gid']?>]" <?php echo $_group['allowPostRead']=="1"?'checked':''?>/></td>
<?php }?></tr>
</table>
 <input type="checkbox" name="old_mode" id="old_mode" value="old" <?php if($set&&$set['old']) echo 'checked="checked"'; ?>/><label for="old_mode">开启兼容其他插件模式(解析reply标记，但是会降低效率!!!)</label><br>
<button type="submit" class="btn btn-primary btn-block" id="submit" data-loading-text="<?php echo lang('submiting');?>..."><?php echo lang('confirm');?></button>
</form></div></div>
</div></div>
<?php include _include(ADMIN_PATH.'view/htm/footer.inc.htm');?>
<script>
    var jform = $("#form");var jsubmit = $("#submit");
    jform.on('submit', function(){
        jform.reset();jsubmit.button('loading'); var postdata = jform.serialize();
        $.xpost(jform.attr('action'), postdata, function(code, message) {
            if(code == 0) {
                $.alert(message);
                setTimeout(function() {window.location.reload();jsubmit.button('reset');}, 1000);
                return;
            } else {
                $.alert(message);jsubmit.button('reset');}
        });
        return false;
    });
</script>